﻿using System.Collections.Generic;

namespace MQTT.Share.MQTT
{
    public class MqttClientContainer
    {
        private static Dictionary<string, ClientDescriptor> Cache = new Dictionary<string, ClientDescriptor>();

        public static void Add(string clientId, ClientDescriptor client)
        {
            if (!Cache.ContainsKey(clientId))
            {
                Cache.Add(clientId, client);
            }
            else
            {
                Cache[clientId] = client;
            }
        }

        public static ClientDescriptor Get(string clientId)
        {
            return Cache[clientId];
        }

    }
}
